<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<html >
<head>
    <meta charset="UTF-8">
    <title th:text="#{standings} + ' - Online Judge'"></title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" th:href="@{/css/styles.css}" >
    <script th:src="@{/js/jquery-1.7.2.js}"></script>
    <script th:src="@{/js/gdoj.js}"></script>
</head>
<body>
<div th:replace="common::web-navbar"></div>
<div class="container">
    <div class="content">
        <div class="content-with-sidebar"> 	 <!-- class="content-with-sidebar" -->
            <div id="nav-content" >
                <a th:href="@{/problemset}">[[#{problems}]]</a>
                <a th:href="@{/problemset/status}">[[#{status}]]</a>
                <a th:href="@{/problemset/standings}" class="current">[[#{standings}]]</a>
            </div>
            <div class="">
                <table class="standings">
                    <tr class="header" style="">
                        <th  class="rank left-item">#</th>
                        <th  class="coder">[[#{author}]]</th>
                        <th  class="motto">[[#{motto}]]</th>
                        <th  class="solved">[[#{solved}]]</th>
                        <th  class="rating">[[#{rating}]]</th>
                    </tr>
                    <tr th:if="${pageInfo.size == 0}"><td class="left-item dark" colspan="5" style="text-align: left;">[[#{no-record}]]</td></tr>
                    <tr th:each="user,stat : ${pageInfo.list}" th:class="${stat.even}?'dark'">
                        <td class="rank left-item" th:text="${(pageInfo.pageNum - 1) * pageInfo.pageSize + stat.index + 1}"></td>
                        <td class="coder" th:classappend="${session.session_username == user.username} ? 'my': ''">
                            <b><a th:href="@{/profile/{username}(username=${user.username})}" th:class="'user-rate-' + ${user.rate}  + ' user-tip'" th:user="${user.username}" >
                                <img class="mini-avatar" th:src="${user.avatar}"/>
                                <span th:text="${user.username}"></span>
                            </a></b>
                        </td>
                        <td class="motto" th:text="${user.motto}"></td>
                        <td class="solved">
                            <a th:href="@{/problemset/status/{username}/page/1(username=${user.username})}" th:text="${user.solved}"> </a>
                        </td>
                        <td class="rating" th:text="${user.rating}"></td>
                    </tr>
                </table>
            </div>
            <div style="margin:6px 12px;font-size:15px;">
                <div class="left"></div>
                <div class="right">
                    <a th:if="${pageInfo.hasPreviousPage == true}" th:href="@{/problemset/standings/page/{pageNum}(pageNum=${pageInfo.prePage})}" style="color:#000;text-decoration: none;">&larr;</a>
                    <a th:if="${pageInfo.firstPage > 1}" th:href="@{/problemset/standings/page/1}" style="color:#000;text-decoration: none;">1</a>
                    <span th:if="${pageInfo.firstPage > 2}"  >...</span>
                    <span th:each="nav:${pageInfo.navigatepageNums}">
                    <a th:href="@{/problemset/standings/page/{pageNum}(pageNum=${nav})}" th:text="${nav}" th:if="${nav == pageInfo.pageNum}" style="font-weight: bold;color:#000;text-decoration: none;"></a>
                    <a th:href="@{/problemset/standings/page/{pageNum}(pageNum=${nav})}" th:text="${nav}" th:if="${nav != pageInfo.pageNum}" style="color:#000;text-decoration: none;"></a>
                </span>
                    <span th:if="${pageInfo.lastPage < pageInfo.pages}" >...</span>
                    <a th:if="${pageInfo.pages > pageInfo.lastPage}" th:href="@{/problemset/standings/page/{pageNum}(pageNum=${pageInfo.pages})}" th:text="${pageInfo.pages}" style="color:#000;text-decoration: none;"></a>
                    <a th:if="${pageInfo.hasNextPage == true}" th:href="@{/problemset/standings/page/{pageNum}(pageNum=${pageInfo.nextPage})}" style="color:#000;text-decoration: none;">&rarr;</a>
                </div>
            </div>
        </div>
        <div class="sidebar" th:replace="sidebar::web-sidebar"></div>
    </div>
    <div th:replace="common::web-footer"></div>
</div>
</body>
</html>
